package com.webware.view.client.mvp;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;
import com.webware.view.client.ClientFactory;
import com.webware.view.client.place.StartPlace;
import com.webware.view.client.presenter.HeaderPresenter;

public class HeaderActivityMapper implements ActivityMapper {
    private ClientFactory clientFactory;

    public HeaderActivityMapper(ClientFactory clientFactory) {
	super();
	this.clientFactory = clientFactory;
    }

    public Activity getActivity(Place place) {
	if (place instanceof StartPlace)
	    return new HeaderPresenter((StartPlace) place, clientFactory);

	return null;
    }
}
